<template>
    <div>
        <div align="center" style="font-weight: bold;font-size: 20px;margin-bottom: 20px;">{{showMonth}}账单汇总表</div>
        <table border="1" cellspacing="0" style="width: 800px;border-top: none;" v-for="(items, indexs) of list">
            <tr style="text-align: center;" v-if="indexs == 0">
                <td rowspan="2" width="15%">结算单位</td>
                <td rowspan="2" width="25%">业务项目</td>
                <td rowspan="2" width="15%">箱量</td>
                <td colspan="3">账单</td>
            </tr>
            <tr style="text-align: center;" v-if="indexs == 0">
                <td width="15%">计费箱量</td>
                <td width="15%">费率</td>
                <td width="15%">金额</td>
            </tr>
            <tr v-for="(item, index) of items.totaldata" :style="item.portIMEX == '本月小计(箱量/收入)' ? 'background-color:#cdcdcd':''">
                <td style="height: 25px;width: 15%;text-align: center;" v-if="index == 0" :rowspan="items.totaldata.length">{{items.accountUnit}}</td>
                <td style="width: 25%;" >{{item.portIMEX}}</td>
                <td style="width: 15%;">{{item.showContainerNum}}</td>
                <td style="width: 15%;">{{(Number(item.containerNum4) + Number(item.containerNum2))== 0 ? "" : (Number(item.containerNum4) + Number(item.containerNum2))}}</td>
                <td style="width: 15%;">{{item.strFeeRate}}</td>
                <td style="width: 15%;">{{item.money}}</td>
            </tr>
        </table>
    </div>
</template>

<script>

    export default {
        name: "monthTotal",
        data() {
            return {
                showMonth :'',
                list : []
            }
        },
        created() {
            this.loadData()
        },
        methods: {
            loadData() {
                this.list = JSON.parse(localStorage.getItem('monthTotalData'))
                this.showMonth = localStorage.getItem('monthTotalDataShowMonth')
                this.$nextTick(()=>{
                    // window.print()
                    // window.close()
                })
            }
        }
    }
</script>

<style scoped>

</style>
